<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var money = 100; //现有100元
        do {
            var result = prompt("请选择：1：存钱  2：取钱  3：退出")
            switch (result) {
                case "1":
                    var cun = Number(prompt("请存钱："))
                    // money+=cun;
                    money=money+cun
                    alert("存钱后有"+money+"元")
                    break;
                case "2":
                    var qu = prompt("请取钱：")
                    money-=qu
                    alert("取钱后有"+money+"元")
                    break;
                case "3":
                    break;
            }
        } while (result=="1"||result=="2")
    </script>
</body>

</html>